<template>
  <div class="app-container clearfix">  
      <el-row>
  <el-col :span="22">
    
     <el-form ref="filterForm" :model="filterForm" :inline="true" label-position="left" label-width="100px">
        <el-form-item label="合约" prop="symbol">
          <el-input v-model="filterForm.symbol" clearable placeholder="合约" style="width: 200px;" class="filter-item" @keyup.enter.native="handleFilter" />
        </el-form-item>
        <el-form-item label="佣金状态" prop="closeStatus">
          
      <el-radio-group v-model="filterForm.closeStatus">
        <el-radio-button label="0">全部</el-radio-button>
        <el-radio-button label="1">已结算</el-radio-button>
        <el-radio-button label="2">未结算</el-radio-button>
      </el-radio-group>
        </el-form-item>
      </el-form>
  </el-col>
  <el-col :span="2">
    <el-button type="primary" @click="handleFilter">刷新</el-button>
  </el-col>
</el-row>
      <el-table
      :data="list"
      border
      style="width: 100%">
      <el-table-column
      type="selection"
      width="55">
    </el-table-column>
      <el-table-column
        label="编码" width="100">
        <template slot-scope="{row}">
          <span>{{ row.commissionCode }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="代理">
        <template slot-scope="{row}">
          <span>{{ row.agent.fullname }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="客户"
        width="140">
        <template slot-scope="{row}">
          <span>{{ row.customer.fullname }}</span>
          <span>{{ row.customer.mobile }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="产品">
        <template slot-scope="{row}">
          <span>{{ row.marketDate }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="佣金"
        width="160">
        <template slot-scope="{row}">
          <span>￥{{ row.amount }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="状态"
        width="100">
        <template slot-scope="{row}">
          <span>{{ row.status.label }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="操作"
        width="100">
        <template slot-scope="{row}">
        </template>
      </el-table-column>
      </el-table>
    <pagination v-show="total>0" :total="total" :page.sync="filterForm.page" :limit.sync="filterForm.size" @pagination="getList" />
  </div>
</template>

<script>
import waves from '@/directive/waves' // waves directive
import Pagination from '@/components/Pagination' // secondary package based on el-pagination
import {getSymbol} from '@/utils/symbol' // secondary package based on el-pagination
import {getCommissionList} from '@/api/distribution/commission'



export default {
  name: 'financeDashboard',
  components: { Pagination },
  directives: { waves },
  filters: {
  },
  data() {
    return {
      
      socket:"",
      tableKey: 0,
      list: null,
      windowHeight:"600",
      total: 0,
      listLoading: false,
      documentationList:[],
      connected:"loading",
      timer:null,
      filterForm: {
        page: 1,
        size: 10,
        localSymbol:"",
        status:5,
        style:"0",
        keyword: undefined
      }
    }
  },
  created() {
    this.getList()
  },
  destroyed () {
  },
  methods: {
    getList:function(){
      let _this = this;
      console.log("期权",_this.filterForm)
      getCommissionList(_this.filterForm).then((response) => {
        console.log("getList",response)
          if (response.code === 200) {
            this.list = response.data.list
            this.total = response.data.total
          } else {
            _this.$message({
              message: response.msg,
              type: 'error'
            })
          }
      })
    },
    handleFilter() {
      this.filterForm.page = 1
      this.getList()
    },
    sortChange:function(){

    }
  }
}
</script>
<style>
.filter { float: left; width: 160px; padding: 20px; min-height: 600px; }
.article { float: left; width: 800px; }
.article-item { width: 800px; height: 200px; margin-right: 25px; }
.article-item-text { float: left; width:600px; }
.article-item-icon { float: right; width:200px; height:150px; padding-left: 50px; }
.article-item-icon img { width:100%; height:100%; border-radius: 10px; }
</style>